from api05 import *
import pprint

login,cookies=login('auto','sdfsdfsdf')
print('登陆成功')

sessionid =cookies['sessionid']

#列出课程
coureListBefore = list_course(sessionid)['retlist']

#修改课程
modify= modify_course('1084','python1','python语言','2',sessionid)
if modify['retcode']==0:
    print('修改课程成功')
else:
    print('修改课程失败')

#列出修改后的课程
coureListafter = list_course(sessionid)['retlist']

#assert 做判断
assert {'desc': 'python语言', 'display_idx': 2, 'id': 1084, 'name': 'python1'}   in coureListafter

# # 清除环境操作
# delete_course('id',sessionid)

print('\n---------test case-----------')
